<%@page import="domain.BlogCommentFile"%>
<%@page import="domain.BlogFile"%>
<%@page import="getools4me.UserManager"%>
<%@page import="java.util.List"%>
<%@page import="getools4me.BlogManager"%>
<%@page import="utils.DateUtils"%>
<%@page import="domain.DownloadableFile"%>
<%@page pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="/blog/css/common.css" />
<link rel="stylesheet" type="text/css" href="/blog/css/menu.css" />
<link rel="stylesheet" type="text/css" href="/blog/css/all.css" />
<script type="text/javascript" src="/blog/js/common.js"></script>

<title>All List</title>
</head>
<body>

<div class="menu">
	<ul>
		<li><a href="/blog/page/home.jsp">Home</a></li>
		<li><a href="/blog/page/all.jsp">All</a></li>
		<li><%if(UserManager.isLogin()){ %><a href="<%=UserManager.getLogoutURL(request)%>">Logout</a><%}else{ %><a href="<%=UserManager.getLoginURL(request)%>">Login</a><%} %></li>
		<li><%if(UserManager.isAdmin()){ %>
		<a href="/blog/page/new.jsp">New</a><%} %>
		</li>
	</ul>
</div>

<div class="bloglist">
	<%for(BlogFile file : BlogManager.getAllBlogFile()){ 
		Long id = file.getId();
		Long lastModifiedDate = file.getLastModifiedDate();
	%>
	<div class="preview">
			<div class="article_title">
				<a href="/blog/page/detail.jsp?blogID=<%=id%>">
				 <span id="<%=id%>.title" class="safeString"><%= new String(file.getTitle()) %></span>
				</a>
			</div>	
			<div class="article_utils">
				<div class="timestamp">
					<span><%=DateUtils.format("yyyy.MMM.",lastModifiedDate)%></span><span class="days"><%=DateUtils.format("dd",lastModifiedDate)%></span>
					&nbsp;&nbsp;<span><%=DateUtils.format("HH:mm:ss",lastModifiedDate)%></span>
				</div>
			<%if(UserManager.isAdmin()){ %>
				<div class="drop">
					<a class="drop" href="/blog/page/admin.jsp?op=delete&target_type=blog&id=<%=id %>&postURL=<%=request.getRequestURI() %>" >Drop</a>
				</div>
			<%} %>
			</div>	
		</div>
	<%} %>
	
	
	<%for(BlogCommentFile file : BlogManager.getAllBlogCommentFile()){ 
		Long id = file.getId();
		Long lastModifiedDate = file.getLastModifiedDate();
	%>
	<div class="preview">
			<div class="article_title">
				<a href="/blog/page/detail.jsp?blogID=<%=file.getBlog_ID()%>&blogCommentID=<%=id%>#blogCommentID_<%=id%>">
				 <span id="<%=id%>.title" class="safeString"><%= new String(file.getTitle()) %></span>
				</a>
			</div>	
			
			<div class="article_utils">
				<div class="timestamp">
					<span><%=DateUtils.format("yyyy.MMM.",lastModifiedDate)%></span><span class="days"><%=DateUtils.format("dd",lastModifiedDate)%></span>
					&nbsp;&nbsp;<span><%=DateUtils.format("HH:mm:ss",lastModifiedDate)%></span>
				</div>
				<%if(UserManager.isAdmin()){ %>
					<div class="drop">
						<a class="drop" href="/blog/page/admin.jsp?op=delete&target_type=comment&id=<%=id %>&postURL=<%=request.getRequestURI() %>" >Drop</a>
					</div>
				<%} %>		
			</div>	
		</div>
	<%} %>
	
</div>


<script type="text/javascript">
	new Common().convertSafeStringClassElementInnerHtmlFromUnicodeToSafeString(document);
</script>

<div class="south">
	<div class="footer">
		<iframe class="footer" src="/footer.html" frameborder="0" width="100%"></iframe>
	</div>
</div>



</body>
</html>